{% extends "base_site.html" %}
{% load i18n %}
{% load tabind %}

{% block content_title %}
<h2>{{ content_title }}</h2>
{% endblock %}
{% block content %}
  {% filter one_space %}
  <div id="content-main">
    {% if can_read %}
      {% if data %}
        <ul>
          {% for elem in data %}
            <li>
              {% if elem.1 %}
                {{ elem.0 }}: {{ elem.1 }}
              {% else %}
                {% ifequal object.classname.classname "Link" %}
                  {{ elem.0 }}: <span class="link-but"><a href="/add/{{ elem.2}}/{{object.id }}/">Add {{ elem.2 }}</a></span>
                {% else %}
                  {{ elem.0 }}:
                {% endifequal %}
              {% endif %}
            </li>
            {% endfor %}
        </ul>
      {% endif %}
      {% if subject_list %}
        <h2>Data as subject in Link:</h2>
        <ul>
          {% for elem in subject_list %}
            <li><a href="/base/{{ elem.0.id }}/">Link (id={{ elem.0.id }})</a>
              {% if elem.1 %}
                Property: <a href="/base/{{ elem.1.id }}/">{{ elem.1 }}</a>
              {% else %}
                Property: <span class="link-but"><a href="/add/{{ elem.0.link_type.classname2 }}/{{ elem.0.id }}/">Add {{ elem.0.link_type.classname2 }}</a></span>
              {% endif %}
              Linktype: <a href="/base/{{ elem.0.link_type.id }}/">{{ elem.0.link_type }}</a>
            </li>
          {% endfor %}
       </ul>
      {% endif %}
      {% if property_list %}
        <h2>Data as property in Link:</h2>
        <ul>
          {% for elem in property_list %}
            <li><a href="/base/{{ elem.0.id }}/">Link (id={{ elem.0.id }})</a>
              {% if elem.1 %}
                Subject: <a href="/base/{{ elem.1.id }}/">{{ elem.1 }}</a>
              {% else %}
                Subject: <a href="/add/{{ elem.0.link_type.classname1 }}/">Add {{ elem.0.link_type.classname2 }}</a>
              {% endif %}
              Linktype: <a href="/base/{{ elem.0.link_type.id }}/">{{ elem.0.link_type }}</a>
            </li>
          {% endfor %}
        </ul>
      {% endif %}
    {% else %}
      <p>{% trans 'You have no read permissions.' %}</p>
    {% endif %}
    {% if not can_write%}
      <p>{% trans 'You have no edit permissions' %}</p>
    {% else %}
      <div>
        <form action="/openform/usage/" method="post">{% csrf_token %}
          <div>
            <input type="hidden" name="dtform" value="{{ user_action }}" />
            <input type="submit" value="{{ butvalue }}" name="btusage" />
            {% if delvalue %}
            <input type="submit" value="{{ delvalue }}" name="btusage" />
            {% endif %}
          </div>
        </form>
      </div>
    {% endif %}
  </div>
  {% endfilter %}
{% endblock %}
